home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / setuid.c < prev    next >
C/C++ Source or Header  |  1994-03-01  |  322b  |  27 lines

  1. #include <types.h>
  2. #include <unistd.h>
  3. #include <osbind.h>
  4. #include <mintbind.h>
  5. #include <errno.h>
  6.  
  7. extern int __mint;
  8. extern uid_t __uid;
  9.  
  10. int
  11. setuid(x)
  12.   int x;
  13. {
  14.   long r;
  15.  
  16.   if (__mint) {
  17.     r = Psetuid(x);
  18.     if (r < 0) {
  19.       errno = (int) -r;
  20.       return -1;
  21.     }
  22.     return 0;
  23.   }
  24.   __uid = x;
  25.   return 0;
  26. }
  27.